<%- include ../include/head %>
       <input type="hidden" id="js_current" value="user_list"/>
			<h2>User</h2>
			<p id="page-intro">Add User?</p>
			<div class="clear"></div> <!-- End .clear -->
			<div class="content-box"><!-- Start Content Box -->
				<div class="content-box-header">
					<h3>Add user</h3>
					<ul class="content-box-tabs">
						<li><a href="#tab1" class="default-tab">Forms</a></li>
					</ul>
					<div class="clear"></div>
				</div> <!-- End .content-box-header -->
				<div class="content-box-content">
					<div class="tab-content default-tab" id="tab1">
						<form  id="js_form" action="/admin/users/edit" method="post">
							<fieldset>
								<p>
									<label>name</label>
										<input class="text-input small-input" type="text" name="name" required value="<%= users.name %>"/>
								</p>
								<p>
									<label>surname/ nickname</label>
									<input class="text-input small-input" type="text" id="medium-input" name="surname" value="<%= users.surname %>"/>
								</p>
								<p>
									<label>phone</label>
									<input class="text-input small-input" type="text" name="phone" value="<%= users.phone %>"/>
								</p>
								<p>
									<label>country</label>
									<select name="country" class="small-input">
										<option value="option1">Option 1</option>
										<option value="option2">Option 2</option>
										<option value="option3">Option 3</option>
										<option value="option4">Option 4</option>
									</select>
								</p>
								<p>
									<label>username</label>
									<input class="text-input small-input" type="text" name="username" pattern="number" pattern="number" value="<%= users.username %>"/>
								</p>
								<p>
									<label>password</label>
									<input class="text-input small-input" type="text" name="password" value="<%= users.password %>"/>
								</p>
								<p>
									<label>email</label>
									<input class="text-input small-input" type="text" name="email" value="<%= users.email %>"/>
								</p>

								<p>
									<label>role</label>
									<select name="role" class="small-input">
										<option value="option1">Option 1</option>
										<option value="option2">Option 2</option>
										<option value="option3">Option 3</option>
										<option value="option4">Option 4</option>
									</select> 
								</p>
								<p>
									<input class="button" type="submit" value="Submit" />
								</p>
							</fieldset>
							<div class="clear"></div><!-- End .clear -->
						</form>
					</div> <!-- End #tab2 -->
				</div> <!-- End .content-box-content -->
			</div> <!-- End .content-box -->
<script>
	requirejs(["jquery","form"],function(){
		var d = dialog();
		$("#js_form").form({
			onAccept:function(ret){
				d.content ("更新成功");
				setTimeout(function(){
					d.close();
				},2000);
				window.location.href="/admin/users/list";
			},
			onError:function(){
				d.content ("更新失败");
				setTimeout(function(){
					d.close();
				},2000);
			}
		});
	});
</script>

<%- include ../include/foot %>